		TITLE	NBKPAT - Copyright (c) SLR Systems 1994
		SUBTTL	Contains Confidential and Proprietary material

		INCLUDE MACROS
		INCLUDE	CDDATA

		PUBLIC	NBKPAT,NBKPAT32


		.DATA

		EXTERNDEF	CLASS_TYPE:BYTE

		EXTERNDEF	END_OF_RECORD:DWORD,FORREF_TYPE:DWORD,LDATA_SEGMOD_GINDEX:DWORD

		EXTERNDEF	SEGMOD_GARRAY:STD_PTR_S


		.CODE	PASS1_TEXT

		EXTERNDEF	MYCOMDAT_INSTALL:PROC,FORREF_CONT:PROC

;
;		DB	TYPE		LOCATION TYPE TO FIX UP
;
;	  	INDEX	PUBLIC NAME	LNAME REFERENCE TO THIS GUY
;
;					NEXT UP TO MANY BYTES OF DATA
;

NBKPAT32	PROC
		;
		;
		;
		MOV	AL,MASK BIT_32+MASK BIT_FR
		JMP	NBKPAT1

NBKPAT32	ENDP

NBKPAT		PROC
		;
		;DS:SI IS DATA RECORD
		;
		MOV	AL,MASK BIT_FR
NBKPAT1::
		MOV	AH,[ESI]
		INC	ESI

		MOV	WPTR FORREF_TYPE,AX

		NEXT_INDEXI
		;
		;THROW-AWAY CRITERIA -
		;
		;	1.  THROW AWAY IF ZERO-LENGTH
		;	2.  THROW AWAY IF NOT KEEPING THIS COMDAT INSTANCE
		;
		MOV	ECX,END_OF_RECORD		;SKIP IF ZERO-LENGTH

		SUB	ECX,ESI
		JBE	L9$

		MOV	EDI,ECX
		CALL	MYCOMDAT_INSTALL		;EAX IS INDEX, ECX IS PHYSICAL
		ASSUME	ECX:PTR MYCOMDAT_STRUCT

		MOV	DL,[ECX]._MCD_FLAGS
		MOV	EAX,[ECX]._MCD_SEGMOD_GINDEX

		AND	DL,MASK MCD_KEEPING_THIS
		JZ	L9$				;SKIP IF NOT KEEPING THIS INSTANCE

		MOV	LDATA_SEGMOD_GINDEX,EAX
		CONVERT	EAX,EAX,SEGMOD_GARRAY
		ASSUME	EAX:PTR CDSEGMOD_STRUCT
		MOV	AL,[EAX]._CDSM_SMFLAGS		;FOR CODE-DATA DETERMINATION

		MOV	ECX,EDI
		MOV	CLASS_TYPE,AL

		JMP	FORREF_CONT

L9$:
		RET

NBKPAT		ENDP


		END

